package com.ns.scs.comments.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 资源评论实体
 *
 * @author lw
 * @since 2024-11-15
 */
@Data
@ToString
@Accessors(chain = true)
public class CommentsVO implements Serializable {

    @Serial
    private static final Long serialVersionUID = 1L;
    /**
     * id，--主键、自增
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /**
     * 关联评论id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long pid;

    /**
     * 资源id
     */
    private Long resourceId;

    /**
     * 资源名称
     */
    private String resourceName;

    /**
     * 收藏资源类型
     */
    private String type;

    /**
     * 用户id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long commentator;

    /**
     * 用户名
     */
    private String uname;

    /**
     * 头像
     */
    private String avatar;

    /**
     * 评论
     */
    private String note;

    /**
     * 点赞数
     */
    private String likes;

    /**
     * 输入按钮
     */
    private Integer inputShow;

    /**
     * 状态
     */
    private Integer status;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 删除标识 0正常 1删除
     */
    private Integer deleted;


    /**
     * 下级评论
     */
    private List<CommentsVO> children;

}
